from aiogram.filters import BaseFilter
from aiogram import types


class WithDeepLink(BaseFilter):
    """
    Зарегистрирован ли пользователь в боте.
    """
    def __init__(self, with_deep_link: bool = True):
        self.with_deep_link = with_deep_link

    async def __call__(self, update: types.Message) -> bool:
        if len(update.text.split(' ')) > 1:
            return True is self.with_deep_link
        return False is self.with_deep_link
